﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Visitor;

namespace ASTClass
{
    class FactorAST : AST
    {
        public FactorAST() : base() { name = "Factor"; }
        public FactorAST(AST parent) : base(parent) { name = "Factor"; }

        public override AST  Clone() 
        {
            FactorAST ast = new FactorAST();
            ast.operators = operators;
            foreach (AST c in children)
                ast.children.Add(c.Clone());
      
            return ast;
        }

        #region Visitor pattern

        public override void Accept(IVisitor visitor)
        {
            visitor.Visit(this);
        }

        #endregion Visitor pattern
    }
}
